import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:liuxlcommon/view/lxl_widget.dart';
import 'package:liuxlcommon/view/my_box.dart';
import 'package:love_newf/generated/assets.dart';
import 'package:love_newf/value/app_const.dart';

class VipGradeLabel extends StatelessWidget {
  int vipGrade;

  VipGradeLabel(this.vipGrade, {super.key});

  @override
  Widget build(BuildContext context) {
    return LText.easy("Lv$vipGrade",12.w,fw5,Colors.white)
    .center()
        .bgImg(getVipColor(vipGrade))
        .radius(15.w).size(30.w,null) ;
  }

  String getVipColor(int vipGrade) {

    if (vipGrade <= 10)  return Assets.vipBgLiveGrade110;
     else if (vipGrade <= 20)  return Assets.vipBgLiveGrade1020;
     else if (vipGrade <= 30)  return Assets.vipBgLiveGrade2030;
     else if (vipGrade <= 40)  return Assets.vipBgLiveGrade3040;
     else if (vipGrade <= 50)  return Assets.vipBgLiveGrade4050;
     else if (vipGrade <= 60)  return Assets.vipBgLiveGrade5060;
     else if (vipGrade <= 70)  return Assets.vipBgLiveGrade6070;
     else return Assets.vipBgLiveGrade7090;    // if (vipGrade <= 90)

  }
}
